package com.taichuan.selfcheck.eventbus;

/**
 * 该类主要用于
 *
 * @author CamelLuo
 * @version 2020/5/13
 */
public class McuSendUpdatePackageResultEvent {

    public static final int MCU_UPDATE_PACKAGE_RECEIVE_TYPE_SUCESS = 1;         //数据已成功写入单片机
    public static final int MCU_UPDATE_PACKAGE_RECEIVE_TYPE_FAILURE = 2;        //数据写入单片机失败

    /**
     * 单片机接收升级包数据结果类型
     */
    private int receiveResultType;
    /**
     * 本次单片机程序升级包所需要发送的总包数
     */
    private int totalPackageCount;
    /**
     * 本次发送的包序号(从1开始)
     */
    private int currentPackageNum;

    public McuSendUpdatePackageResultEvent(int receiveResultType, int totalPackageCount, int currentPackageNum) {
        this.receiveResultType = receiveResultType;
        this.totalPackageCount = totalPackageCount;
        this.currentPackageNum = currentPackageNum;
    }

    public int getReceiveResultType() {
        return receiveResultType;
    }

    public int getTotalPackageCount() {
        return totalPackageCount;
    }

    public int getCurrentPackageNum() {
        return currentPackageNum;
    }

    @Override
    public String toString() {
        return "McuSendUpdatePackageResultEvent{" +
                "receiveResultType=" + receiveResultType +
                ", totalPackageCount=" + totalPackageCount +
                ", currentPackageNum=" + currentPackageNum +
                '}';
    }
}
